package xio.ccf_201403;

import java.util.*;

/**
 * ccf 201403-4 无线网络 100分 BFS
 * Created by Xio on 2017/11/15 0015.
 */
public class WirelessNetwork {
    public static void main(String[] agrs){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int k = sc.nextInt();
        int r = sc.nextInt();


        boolean[][] graph = new boolean[m+n][m+n];
        int[][] points = new int[201][2];
        for (int i = 0; i < n+m; i++) {
            points[i][0] = sc.nextInt();
            points[i][1] = sc.nextInt();

        }
        for (int i = 0; i < n + m; i++) {
            for (int j = i+1; j < n + m; j++) {
                int x1 = points[i][0];
                int y1 = points[i][1];
                int x2 = points[j][0];
                int y2 = points[j][1];
                graph[i][j] = graph[j][i] =inRange(x1,x2,y1,y2,r);
            }
        }

        int len = 1;
        LinkedList<Pair> q = new LinkedList<>();
        boolean marked[] = new boolean[m+n];
        q.add(new Pair(0,0));
        int level =0;
        int newLen = 0;
        while (len>0){
            for (int i = 0; i < len; i++) {
                Pair pair = q.poll();
                if (pair.v == 1) System.out.println(level-1+"");
                for (int j = 0; j < n; j++) {
                    if (graph[pair.v][j] && !marked[j] ){
                        q.add(new Pair(j,pair.k));
                        marked[j] =true;
                        newLen++;
                    }
                }
                for (int j = n; j < n+m; j++) {
                    if (graph[pair.v][j] && !marked[j] && pair.k<=k){
                        q.add(new Pair(j,pair.k++));
                        marked[j] =true;
                        newLen++;
                    }
                }
            }
            len = newLen;
            newLen = 0;
            level++;
        }



    }

    private static boolean inRange(int x1, int x2, int y1, int y2, int R){
        return Math.sqrt(Math.pow(x1-x2,2) + Math.pow(y1-y2,2)) <= R;
    }


    static class Pair{
        int v;
        int k;

        public Pair(int v, int k) {
            this.v = v;
            this.k = k;
        }
    }

}
